//
//  FCCyclePagerViewCell.m
//  FundChain
//
//  Created by 肖浩然的mac on 2018/2/28.
//  Copyright © 2018年 RUIXIN. All rights reserved.
//

#import "FCCyclePagerViewCell.h"

@implementation FCCyclePagerViewCell
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor clearColor];
        [self setupUI];
    }
    return self;
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    if (self = [super initWithCoder:aDecoder]) {
        self.backgroundColor = [UIColor clearColor];
        [self setupUI];
    }
    return self;
}
#pragma mark-设置UI
- (void)setupUI {
    /* 头部Image */
    self.topImageView = [UIImageView new];
    [self addSubview:self.topImageView];
    [self.topImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.mas_equalTo(0);
        make.height.mas_equalTo(40);
    }];
    self.topImageView.userInteractionEnabled = YES;
    self.topImageView.image = [UIImage imageNamed:@"bg_wallet_title"];
    /* 货币image */
    self.moneyImageView = [UIImageView new];
    [self.topImageView addSubview:self.moneyImageView];
    [self.moneyImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20*KScreenWidthScale750);
        make.centerY.mas_equalTo(0);
        make.size.mas_equalTo(CGSizeMake(22, 22));
    }];
    self.moneyImageView.image = [UIImage imageNamed:@"btc_22pt"];
    /* 币种名 */
    self.moneyLabel = [UILabel new];
    [self.topImageView addSubview:self.moneyLabel];
    [self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.moneyImageView.mas_right).offset(12*KScreenWidthScale750);
        make.centerY.mas_equalTo(0);
    }];
    self.moneyLabel.text = Localized(@"比特币");
    self.moneyLabel.font = Kfont(32);
    self.moneyLabel.textColor = kWhiteColor;
    /* 删除按钮 */
    self.deleteBtn = [UIButton new];
    [self.topImageView addSubview:self.deleteBtn];
    [self.deleteBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-20*KScreenWidthScale750);
        make.centerY.mas_equalTo(0);
        make.size.mas_equalTo(CGSizeMake(30, 30));
    }];
    [self.deleteBtn setImage:[UIImage imageNamed:@"delete"] forState:UIControlStateNormal];
    
    
    
    //下半部
    //阴影
    UIView *shadowView = [UIView new];
    [self insertSubview:shadowView atIndex:999];
    [shadowView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.topImageView.mas_bottom);
        make.left.mas_equalTo(0);
        make.size.mas_equalTo(CGSizeMake(520*KScreenWidthScale750, 234*KScreenHeightScale1334));
        make.right.mas_equalTo(0);
    }];
    //阴影的颜色
    shadowView.layer.shadowColor = [UIColor blackColor].CGColor;
    //阴影的透明度
    shadowView.layer.shadowOpacity = 0.3f;
    //阴影的圆角
    shadowView.layer.shadowRadius = 4.f;
    //阴影偏移量
    shadowView.layer.shadowOffset = CGSizeMake(0,4);
    
    /* bottomImage */
    self.bottomImageView = [UIImageView new];
    [shadowView addSubview:self.bottomImageView];
    [self.bottomImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.mas_equalTo(0);
        make.top.mas_equalTo(self.topImageView.mas_bottom);
    }];
    self.bottomImageView.image = [UIImage imageNamed:@"bg_wallet_balance_noshadow"];
    /* 多少币 */
    self.muchMoneyLabel = [UILabel new];
    [self.bottomImageView addSubview:self.muchMoneyLabel];
    [self.muchMoneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(60*KScreenHeightScale1334);
        make.left.mas_equalTo(20*KScreenWidthScale750);
    }];
    self.muchMoneyLabel.text = @"0.00000000";
    self.muchMoneyLabel.font = KOverstrikingfont(52);
    self.muchMoneyLabel.textColor = kWhiteColor;
    /* 多少币种 */
    self.muchMoneyTypeLabel = [UILabel new];
    [self.bottomImageView addSubview:self.muchMoneyTypeLabel];
    [self.muchMoneyTypeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(self.muchMoneyLabel.mas_bottom).offset(-2);
        make.left.mas_equalTo(self.muchMoneyLabel.mas_right).offset(10*KScreenWidthScale750);
    }];
    self.muchMoneyTypeLabel.text = @"USD";
    self.muchMoneyTypeLabel.font = Kfont(28);
    self.muchMoneyTypeLabel.textColor = HEXCOLOR(0xeeeeee);
    /* 等值 */
    self.equivalentLabel = [UILabel new];
    [self.bottomImageView addSubview:self.equivalentLabel];
    [self.equivalentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.muchMoneyLabel.mas_bottom).offset(30*KScreenHeightScale1334);
        make.left.mas_equalTo(20*KScreenWidthScale750);
    }];
    self.equivalentLabel.text = Localized(@"等值");
    self.equivalentLabel.font = Kfont(28);
    self.equivalentLabel.textColor = HEXCOLOR(0x82b8d9);
    /* 等值多少 */
    self.equivalentCountLabel = [UILabel new];
    [self.bottomImageView addSubview:self.equivalentCountLabel];
    [self.equivalentCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.muchMoneyLabel.mas_bottom).offset(30*KScreenHeightScale1334);
        make.left.mas_equalTo(self.equivalentLabel.mas_right).offset(8);
    }];
    //    self.equivalentCountLabel.text = @"0.16770861 BTC";
    self.equivalentCountLabel.font = Kfont(28);
    self.equivalentCountLabel.textColor = HEXCOLOR(0xe0e0e0);
    
}


@end

